# Create duplex links between the 20 infrastructure nodes (routers)
#
$ns duplex-link $n(0) $n(1)   100Mb 10ms DropTail
$ns duplex-link $n(0) $n(2)   100Mb 10ms DropTail
$ns duplex-link $n(1) $n(3)   100Mb 10ms DropTail
$ns duplex-link $n(1) $n(4)   100Mb 10ms DropTail
$ns duplex-link $n(1) $n(5)   100Mb 10ms DropTail
$ns duplex-link $n(2) $n(4)   100Mb 10ms DropTail
$ns duplex-link $n(2) $n(5)   100Mb 10ms DropTail
$ns duplex-link $n(3) $n(6)   100Mb 10ms DropTail
$ns duplex-link $n(3) $n(7)   100Mb 10ms DropTail
$ns duplex-link $n(3) $n(16)  100Mb 10ms DropTail
$ns duplex-link $n(3) $n(17)  100Mb 10ms DropTail
$ns duplex-link $n(4) $n(8)   100Mb 10ms DropTail
$ns duplex-link $n(4) $n(9)   100Mb 10ms DropTail
$ns duplex-link $n(5) $n(13)  100Mb 10ms DropTail
$ns duplex-link $n(5) $n(14)  100Mb 10ms DropTail
$ns duplex-link $n(5) $n(15)  100Mb 10ms DropTail
$ns duplex-link $n(8) $n(18)  100Mb 10ms DropTail
$ns duplex-link $n(9) $n(10)  100Mb 10ms DropTail
$ns duplex-link $n(9) $n(11)  100Mb 10ms DropTail
$ns duplex-link $n(9) $n(12)  100Mb 10ms DropTail
$ns duplex-link $n(10) $n(19) 100Mb 10ms DropTail

set numRouters 20
for {set i 0} {$i < $numRouters} {incr i} {
    $n($i) shape "hexagon"
}


# Create and connect 20 servers to the simulated network
#
$ns duplex-link $n(6) $n(20) 100Mb 10ms DropTail
$ns duplex-link $n(6) $n(21) 100Mb 10ms DropTail
$ns duplex-link $n(6) $n(22) 100Mb 10ms DropTail
$ns duplex-link $n(6) $n(23) 100Mb 10ms DropTail
$ns duplex-link $n(7) $n(24) 100Mb 10ms DropTail
$ns duplex-link $n(7) $n(25) 100Mb 10ms DropTail
$ns duplex-link $n(7) $n(26) 100Mb 10ms DropTail
$ns duplex-link $n(8) $n(27) 100Mb 10ms DropTail
$ns duplex-link $n(8) $n(28) 100Mb 10ms DropTail
$ns duplex-link $n(10) $n(29) 100Mb 10ms DropTail
$ns duplex-link $n(10) $n(30) 100Mb 10ms DropTail
$ns duplex-link $n(11) $n(31) 100Mb 10ms DropTail
$ns duplex-link $n(11) $n(32) 100Mb 10ms DropTail
$ns duplex-link $n(11) $n(33) 100Mb 10ms DropTail
$ns duplex-link $n(11) $n(34) 100Mb 10ms DropTail
$ns duplex-link $n(15) $n(35) 100Mb 10ms DropTail
$ns duplex-link $n(15) $n(36) 100Mb 10ms DropTail
$ns duplex-link $n(15) $n(37) 100Mb 10ms DropTail
$ns duplex-link $n(15) $n(38) 100Mb 10ms DropTail
$ns duplex-link $n(15) $n(39) 100Mb 10ms DropTail

set numServers 20
for {set i 0} {$i < $numServers} {incr i} {
    $n([expr $i + 20]) shape "square"
}



# Create 140 end nodes and connect them to the network
#
$ns duplex-link $n(16) $n(40) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(41) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(42) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(43) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(44) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(45) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(46) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(47) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(48) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(49) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(50) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(51) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(52) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(53) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(54) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(55) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(56) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(57) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(58) 100Mb 10ms DropTail
$ns duplex-link $n(16) $n(59) 100Mb 10ms DropTail

$ns duplex-link $n(17) $n(60) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(61) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(62) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(63) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(64) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(65) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(66) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(67) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(68) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(69) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(70) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(71) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(72) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(73) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(74) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(75) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(76) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(77) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(78) 100Mb 10ms DropTail
$ns duplex-link $n(17) $n(79) 100Mb 10ms DropTail

$ns duplex-link $n(18) $n(80) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(81) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(82) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(83) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(84) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(85) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(86) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(87) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(88) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(89) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(90) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(91) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(92) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(93) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(94) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(95) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(96) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(97) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(98) 100Mb 10ms DropTail
$ns duplex-link $n(18) $n(99) 100Mb 10ms DropTail

$ns duplex-link $n(19) $n(100) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(101) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(102) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(103) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(104) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(105) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(106) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(107) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(108) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(109) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(110) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(111) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(112) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(113) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(114) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(115) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(116) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(117) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(118) 100Mb 10ms DropTail
$ns duplex-link $n(19) $n(119) 100Mb 10ms DropTail

$ns duplex-link $n(12) $n(120) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(121) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(122) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(123) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(124) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(125) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(126) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(127) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(128) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(129) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(130) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(131) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(132) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(133) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(134) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(135) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(136) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(137) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(138) 100Mb 10ms DropTail
$ns duplex-link $n(12) $n(139) 100Mb 10ms DropTail

$ns duplex-link $n(13) $n(140) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(141) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(142) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(143) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(144) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(145) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(146) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(147) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(148) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(149) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(150) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(151) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(152) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(153) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(154) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(155) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(156) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(157) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(158) 100Mb 10ms DropTail
$ns duplex-link $n(13) $n(159) 100Mb 10ms DropTail

$ns duplex-link $n(14) $n(160) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(161) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(162) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(163) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(164) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(165) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(166) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(167) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(168) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(169) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(170) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(171) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(172) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(173) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(174) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(175) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(176) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(177) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(178) 100Mb 10ms DropTail
$ns duplex-link $n(14) $n(179) 100Mb 10ms DropTail


# Set nodes characteristics




